# Contributor: TBK <alpine@jjtc.eu>
# Maintainer:
pkgname=py3-pyftpdlib
_pkgname=${pkgname#py3-}
pkgver=1.5.9
pkgrel=0
pkgdesc="Extremely fast and scalable Python FTP server library."
url="https://pypi.org/project/pyftpdlib/"
arch="noarch"
license="MIT"
depends="py3-openssl py3-pysendfile"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-psutil py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
3efa07f5522cee89d2bf60c93b1315dfb149da622f34e043aca0ac1c4336c0a0885d7238123068401afa6988da9cbde6adfac78f08918d3a14e84c17ebb8b32f  pyftpdlib-1.5.9.tar.gz
"
